function logindownload(){
$.each($('.popup'), function(index, value) {
var href = $(value).attr("href");
$(value).attr("href",downloadURL(href));
});
}

function downloadURL(url ){
var result = url.replace("/resources/","");
result = "/nbodownload/download/?path="+encodeURIComponent(result);
return result;
}

function closePopup(){
  $.colorbox.close();
	tonormal();
}
$(document).ready(function(){
  	logindownload();
	}
);